package jihe;

import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.PriorityQueue;

public class xiaogendui {
    public static void main(String[] args) {
        PriorityQueue<Integer> priorityQueue=new PriorityQueue<>();
        int[] nums={1,3,5,7,2,4,6,8};
        for(int i=0;i<nums.length;i++){
            priorityQueue.offer(nums[i]);
        }
        int[] ret=new int[4];
        for(int i=0;i<4;i++){
            ret[i]=priorityQueue.poll();
        }
        System.out.println(Arrays.toString(ret));

    }
}
